package com.ruicar.afs.cloud.product.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @author xudongdong
 * @version 1.0
 * @date 2020-05-26
 */
@Data
@TableName("product_update")
@ApiModel(value = "产品修改表")
public class ProductUpdate extends BaseEntity<ProductUpdate> {

    @ApiModelProperty(value = "方案编号")
    private String planNumber;

    @ApiModelProperty(value = "方案名称")
    private String planName;

    @ApiModelProperty(value = "生效时间 ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date effectiveDate;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "流程实例ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dataId;

    @ApiModelProperty(value = "产品模板ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotBlank(message = "产品模板ID不能为空")
    private Long productTemplateId;

    @ApiModelProperty(value = "模板类别;主产品、子产品")
    private String templateCategory;

    @ApiModelProperty(value = "开始时间 ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    @ApiModelProperty(value = "结束时间 ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    @ApiModelProperty(value = "贴息方案编号")
    @JsonSerialize(using = ToStringSerializer.class)
    private String discountPlanId;

    @ApiModelProperty(value = "贴息方案名称")
    private String discountPlanName;

    @ApiModelProperty(value = "附加贷方案编号")
    @JsonSerialize(using = ToStringSerializer.class)
    private String extrasPlanId;

    @ApiModelProperty(value = "附加贷方案名称")
    private String extrasPlanName;

    @ApiModelProperty(value = "产品投放方案编号")
    @JsonSerialize(using = ToStringSerializer.class)
    private String launchPlanId;

    @ApiModelProperty(value = "产品投放方案名称")
    private String launchPlanName;

    @ApiModelProperty(value = "风险定价方案编号")
    @JsonSerialize(using = ToStringSerializer.class)
    private String riskPlanId;

    @ApiModelProperty(value = "风险定价方案名称")
    private String riskPlanName;

    @ApiModelProperty(value = "融资校验方案编号")
    @JsonSerialize(using = ToStringSerializer.class)
    private String financePlanId;

    @ApiModelProperty(value = "融资校验方案名称")
    private String financePlanName;

}
